<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of maskCircle</title>
  <meta name="keywords" content="maskCircle">
  <meta name="description" content="Creates an image of a 'pie slice' of a circle.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>maskCircle
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Creates an image of a 'pie slice' of a circle.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function mask = maskCircle( angleStart, angleSiz, r, nSamples ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Creates an image of a 'pie slice' of a circle.

 Creates a 2D array of size (2rx2r) with values between 0 and 1.
 Specifically, mask has values 1 inside the pie slice of the circle
 defined by angleStart and angleSiz.  For example, using
 angleStart=-pi/4 and angleSiz=pi/2 would give a quarter circle facing
 right.  nsample conrols the accuracty of the circle at its boundaries.
 That is if nSamples&gt;1, pixels at the boundary which will have fractions
 values (when a pixel should be say half inside the circle and half
 outside of the circle).  Note that running time is
 O(nSamples^2*radius^2), so don't use a value that is too high for either.
 A series of masks whose angles together go from 0-2pi will sum exactly to
 form a radius r circle. r may be either an integer, or an integer + .5. A
 pixel is considered to belong to the circle iff it is within the given
 angle and has a value strictly smaller then r.
 
 USAGE
  mask = maskCircle( angleStart, angleSiz, r, [nSamples] )

 INPUTS
  angleStart   - start position of circle
  angleSiz     - number of radians to continue circle for
  r            - mask radius (integer or integer+.5)
  nSamples     - [1] controls sampling accuracy

 OUTPUTS
  mask         - the created image, size 2r by 2r

 EXAMPLE
  mask1 = maskCircle( -pi/8, pi/4, 20, 20 ); figure(1); im(mask1); 
  mask2 = maskCircle( pi/8, pi/8, 20, 20 );  figure(2); im(mask2); 
  figure(3); im(mask1+mask2);

 See also <a href="maskEllipse.html" class="code" title="function mask = maskEllipse( mRows, nCols, varargin )">MASKELLIPSE</a>, <a href="maskSphere.html" class="code" title="function mask = maskSphere( d, r, show )">MASKSPHERE</a>

 Piotr's Computer Vision Matlab Toolbox      Version 2.0
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
